package zl.osimall.common.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Validated
public class Category {
    @NotBlank(message = "id不能为空")
    private int id;//类别id
    @NotBlank(message = "类别名不能为空")
    private String name;//类别名称

    private String dscp;//类别描述

    private String pic;//类别图片
    @NotNull(message = "父类别不能为空")
    private Integer parentId;//类别父id

    private Integer recom;//是否推荐

    private Integer status;//是否上架

    private Category parent;//父类别

    private List<Category> children;//该分类的所有子分类
}
